home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2004 September / maximum-cd-2004-09.iso / Software / Apps / CorelDRAWGraphicsSuite12.exe / CorelDRAW Graphics Suite 12.msi / Binary.NewBinary23 < prev    next >
Encoding:
Text File  |  2004-01-07  |  12.4 KB  |  327 lines

  1. Const msiNoAction = -1
  2. Const msiInstallStateAdvertise = 1
  3. Const msiInstallStateAbsent = 2
  4. Const msiInstallStateLocal = 3
  5. Const msiInstallStateSource = 4
  6. Const msiInstallStateDefault = 5
  7. Dim nRemoveVBAEN:nRemoveVBAEN = 0
  8. Dim nRemoveVBACZ:nRemoveVBACZ = 0
  9. Dim nRemoveVBANL:nRemoveVBAPL = 0
  10.  
  11. On Error Resume Next
  12.     
  13.  
  14. If (IsFeatureExists("EN") = 1) Then
  15.     If (Session.Property("ENLANG") = "1") Then
  16.         If (IsFeatureSelected("MainApplications") = True) Then
  17.             Session.FeatureRequestState("EN") = msiInstallStateLocal
  18.         End If
  19.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  20.             Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
  21.         End If
  22.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  23.             Session.FeatureRequestState("English") = msiInstallStateLocal
  24.             Session.FeatureRequestState("WT4ENLANG") = msiInstallStateLocal
  25.         End If
  26.     Else
  27.         Session.FeatureRequestState("English") = msiInstallStateAbsent
  28.         Session.FeatureRequestState("WT4ENLANG") = msiInstallStateAbsent
  29.         Session.FeatureRequestState("EN") = msiInstallStateAbsent
  30.         nRemoveVBAEN = 1
  31.     End If
  32. End If
  33. If (IsFeatureExists("FR") = 1) Then
  34.     If (Session.Property("FRLANG") = "1") Then
  35.         If (IsFeatureSelected("MainApplications") = True) Then
  36.             Session.FeatureRequestState("FR") = msiInstallStateLocal
  37.         End If
  38.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  39.             Session.FeatureRequestState("VBAFR") = msiInstallStateLocal
  40.         End If
  41.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  42.             Session.FeatureRequestState("French") = msiInstallStateLocal
  43.             Session.FeatureRequestState("WT4FRLANG") = msiInstallStateLocal
  44.         End If
  45.     Else
  46.         Session.FeatureRequestState("FR") = msiInstallStateAbsent
  47.         Session.FeatureRequestState("VBAFR") = msiInstallStateAbsent
  48.         Session.FeatureRequestState("French") = msiInstallStateAbsent
  49.         Session.FeatureRequestState("WT4FRLANG") = msiInstallStateAbsent
  50.     End If
  51. End If
  52. If (IsFeatureExists("DE") = 1) Then
  53.     If (Session.Property("DELANG") = "1") Then
  54.         If (IsFeatureSelected("MainApplications") = True) Then
  55.             Session.FeatureRequestState("DE") = msiInstallStateLocal
  56.         End If
  57.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  58.             Session.FeatureRequestState("VBADE") = msiInstallStateLocal
  59.         End If
  60.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  61.             Session.FeatureRequestState("German") = msiInstallStateLocal
  62.             Session.FeatureRequestState("WT4DELANG") = msiInstallStateLocal
  63.         End If
  64.     Else
  65.         Session.FeatureRequestState("DE") = msiInstallStateAbsent
  66.         Session.FeatureRequestState("VBADE") = msiInstallStateAbsent
  67.         Session.FeatureRequestState("German") = msiInstallStateAbsent
  68.         Session.FeatureRequestState("WT4DELANG") = msiInstallStateAbsent
  69.     End If
  70. End If
  71. If (IsFeatureExists("JP") = 1) Then
  72.     If (Session.Property("JPLANG") = "1") Then
  73.         If (IsFeatureSelected("MainApplications") = True) Then
  74.             Session.FeatureRequestState("JP") = msiInstallStateLocal
  75.         End If
  76.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  77.             Session.FeatureRequestState("VBAJP") = msiInstallStateLocal
  78.         End If
  79.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  80.             Session.FeatureRequestState("Japanese") = msiInstallStateLocal
  81.             Session.FeatureRequestState("WT4JPLANG") = msiInstallStateLocal
  82.         End If
  83.     Else
  84.         Session.FeatureRequestState("JP") = msiInstallStateAbsent
  85.         Session.FeatureRequestState("VBAJP") = msiInstallStateAbsent
  86.         Session.FeatureRequestState("Japanese") = msiInstallStateAbsent
  87.         Session.FeatureRequestState("WT4JPLANG") = msiInstallStateAbsent
  88.     End If
  89. End If
  90. If (IsFeatureExists("IT") = 1) Then
  91.     If (Session.Property("ITLANG") = "1") Then
  92.         If (IsFeatureSelected("MainApplications") = True) Then
  93.             Session.FeatureRequestState("IT") = msiInstallStateLocal
  94.         End If
  95.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  96.             Session.FeatureRequestState("VBAIT") = msiInstallStateLocal
  97.         End If
  98.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  99.             Session.FeatureRequestState("Italian") = msiInstallStateLocal
  100.             Session.FeatureRequestState("WT4ITLANG") = msiInstallStateLocal
  101.         End If
  102.     Else
  103.         Session.FeatureRequestState("IT") = msiInstallStateAbsent
  104.         Session.FeatureRequestState("VBAIT") = msiInstallStateAbsent
  105.         Session.FeatureRequestState("Italian") = msiInstallStateAbsent
  106.         Session.FeatureRequestState("WT4ITLANG") = msiInstallStateAbsent
  107.     End If
  108. End If
  109. If (IsFeatureExists("ES") = 1) Then
  110.     If (Session.Property("ESLANG") = "1") Then
  111.         If (IsFeatureSelected("MainApplications") = True) Then
  112.             Session.FeatureRequestState("ES") = msiInstallStateLocal
  113.         End If
  114.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  115.             Session.FeatureRequestState("VBAES") = msiInstallStateLocal
  116.         End If
  117.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  118.             Session.FeatureRequestState("Spanish") = msiInstallStateLocal
  119.             Session.FeatureRequestState("WT4ESLANG") = msiInstallStateLocal
  120.         End If
  121.     Else
  122.         Session.FeatureRequestState("ES") = msiInstallStateAbsent
  123.         Session.FeatureRequestState("VBAES") = msiInstallStateAbsent
  124.         Session.FeatureRequestState("Spanish") = msiInstallStateAbsent
  125.         Session.FeatureRequestState("WT4ESLANG") = msiInstallStateAbsent
  126.     End If
  127. End If
  128. If (IsFeatureExists("BP") = 1) Then
  129.     If (Session.Property("BPLANG") = "1") Then
  130.         If (IsFeatureSelected("MainApplications") = True) Then
  131.             Session.FeatureRequestState("BP") = msiInstallStateLocal
  132.         End If
  133.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  134.             Session.FeatureRequestState("VBABP") = msiInstallStateLocal
  135.         End If
  136.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  137.             Session.FeatureRequestState("Portuguese") = msiInstallStateLocal
  138.             Session.FeatureRequestState("WT4BRLANG") = msiInstallStateLocal
  139.         End If
  140.     Else
  141.         Session.FeatureRequestState("BP") = msiInstallStateAbsent
  142.         Session.FeatureRequestState("VBABP") = msiInstallStateAbsent
  143.         Session.FeatureRequestState("Portuguese") = msiInstallStateAbsent
  144.         Session.FeatureRequestState("WT4BRLANG") = msiInstallStateAbsent
  145.     End If
  146. End If
  147. If (IsFeatureExists("CS") = 1) Then
  148.     If (Session.Property("CSLANG") = "1") Then
  149.         If (IsFeatureSelected("MainApplications") = True) Then
  150.             Session.FeatureRequestState("CS") = msiInstallStateLocal
  151.         End If
  152.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  153.             Session.FeatureRequestState("VBACS") = msiInstallStateLocal
  154.         End If
  155.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  156.             Session.FeatureRequestState("WT4CSLANG") = msiInstallStateLocal
  157.         End If
  158.     Else
  159.         Session.FeatureRequestState("CS") = msiInstallStateAbsent
  160.         Session.FeatureRequestState("VBACS") = msiInstallStateAbsent
  161.         Session.FeatureRequestState("WT4CSLANG") = msiInstallStateAbsent
  162.     End If
  163. End If
  164. If (IsFeatureExists("CT") = 1) Then
  165.     If (Session.Property("CTLANG") = "1") Then
  166.         If (IsFeatureSelected("MainApplications") = True) Then
  167.             Session.FeatureRequestState("CT") = msiInstallStateLocal
  168.         End If
  169.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  170.             Session.FeatureRequestState("VBACT") = msiInstallStateLocal
  171.         End If
  172.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  173.             Session.FeatureRequestState("WT4CTLANG") = msiInstallStateLocal
  174.         End If
  175.     Else
  176.         Session.FeatureRequestState("CT") = msiInstallStateAbsent
  177.         Session.FeatureRequestState("VBACT") = msiInstallStateAbsent
  178.         Session.FeatureRequestState("WT4CTLANG") = msiInstallStateAbsent
  179.     End If
  180. End If
  181. If (IsFeatureExists("KO") = 1) Then
  182.     If (Session.Property("KOLANG") = "1") Then
  183.         If (IsFeatureSelected("MainApplications") = True) Then
  184.             Session.FeatureRequestState("KO") = msiInstallStateLocal
  185.         End If
  186.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  187.             Session.FeatureRequestState("VBAKO") = msiInstallStateLocal
  188.         End If
  189.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  190.             Session.FeatureRequestState("WT4KRLANG") = msiInstallStateLocal
  191.         End If
  192.     Else
  193.         Session.FeatureRequestState("KO") = msiInstallStateAbsent
  194.         Session.FeatureRequestState("VBAKO") = msiInstallStateAbsent
  195.         Session.FeatureRequestState("WT4KRLANG") = msiInstallStateAbsent
  196.     End If
  197. End If
  198. If (IsFeatureExists("NL") = 1) Then
  199.     If (Session.Property("NLLANG") = "1") Then
  200.         If (IsFeatureSelected("MainApplications") = True) Then
  201.             Session.FeatureRequestState("NL") = msiInstallStateLocal
  202.         End If
  203.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  204.             Session.FeatureRequestState("VBANL") = msiInstallStateLocal
  205.         End If
  206.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  207.             Session.FeatureRequestState("Dutch") = msiInstallStateLocal
  208.             Session.FeatureRequestState("WT4NLLANG") = msiInstallStateLocal
  209.         End If
  210.     Else
  211.         Session.FeatureRequestState("NL") = msiInstallStateAbsent
  212.         Session.FeatureRequestState("VBANL") = msiInstallStateAbsent
  213.         Session.FeatureRequestState("Dutch") = msiInstallStateAbsent
  214.         Session.FeatureRequestState("WT4NLLANG") = msiInstallStateAbsent
  215.     End If
  216. End If
  217. If (IsFeatureExists("PL") = 1) Then
  218.     If (Session.Property("PLLANG") = "1") Then
  219.         If (IsFeatureSelected("MainApplications") = True) Then
  220.             Session.FeatureRequestState("PL") = msiInstallStateLocal
  221.         End If
  222.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  223.             Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
  224.         End If
  225.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  226.             Session.FeatureRequestState("Polish") = msiInstallStateLocal
  227.             Session.FeatureRequestState("WT4PLLANG") = msiInstallStateLocal
  228.         End If
  229.     Else
  230.         Session.FeatureRequestState("PL") = msiInstallStateAbsent
  231.         Session.FeatureRequestState("Polish") = msiInstallStateAbsent
  232.         nRemoveVBAPL = 1
  233.     End If
  234. End If
  235. If (IsFeatureExists("CZ") = 1) Then
  236.     If (Session.Property("CZLANG") = "1") Then
  237.         If (IsFeatureSelected("MainApplications") = True) Then
  238.             Session.FeatureRequestState("CZ") = msiInstallStateLocal
  239.         End If
  240.         If (IsFeatureSelected("VBAProgramFiles") = True) Then
  241.             Session.FeatureRequestState("VBAEN") = msiInstallStateLocal
  242.         End If
  243.         If (IsFeatureSelected("DrawProgramFiles") = True) Then
  244.             Session.FeatureRequestState("WT4CZLANG") = msiInstallStateLocal
  245.         End If
  246.     Else
  247.         Session.FeatureRequestState("CZ") = msiInstallStateAbsent
  248.         Session.FeatureRequestState("WT4CZLANG") = msiInstallStateAbsent
  249.         nRemoveVBACZ = 1
  250.     End If
  251. End If
  252.  
  253. If (nRemoveVBAEN = 1) And (nRemoveVBAPL = 1) And (nRemoveVBACZ = 1) Then
  254.     Session.FeatureRequestState("VBAEN") = msiInstallStateAbsent
  255. End If
  256.  
  257. '///////////////////////////////////////////////////////////////////////////
  258. Function IsFeatureExists(sFeature)
  259. On Error Resume Next
  260.  
  261.     Dim objDB: Set objDB = Session.Database
  262.  
  263.     Dim sQuery: sQuery = "SELECT * FROM `Feature` WHERE `Feature`.`Feature` = '" & sFeature & "'"
  264.  
  265.     Dim objView: Set objView = objDB.OpenView(sQuery)
  266.     objView.Execute
  267.  
  268.     Dim objRec: Set objRec = objView.Fetch
  269.  
  270.     If (objRec Is Nothing) Then
  271.         ' not there
  272.         IsFeatureExists = 0
  273.     Else
  274.         ' there
  275.         IsFeatureExists = 1
  276.     End If
  277.  
  278. End Function
  279.  
  280. '*********************************************************************************************
  281. '    Function:    getFeatureAction(sFeature)
  282. '
  283. '    Args:        STRING sFeature = `Feature`.`Feature`
  284. '
  285. '    Returns:    The current install state of the feature
  286. '
  287. '*********************************************************************************************
  288. Function getFeatureState(sFeature)
  289. On Error Resume Next
  290.     getFeatureState = Session.FeatureCurrentState(sFeature)
  291. End Function
  292.  
  293. '*********************************************************************************************
  294. '    Function:    getFeatureAction(sFeature)
  295. '
  296. '    Args:        STRING sFeature = `Feature`.`Feature`
  297. '
  298. '    Returns:    The requested action of the feature
  299. '
  300. '*********************************************************************************************
  301. Function getFeatureAction(sFeature)
  302. On Error Resume Next
  303.     getFeatureAction = Session.FeatureRequestState(sFeature)
  304. End Function
  305.  
  306.  
  307. '*********************************************************************************************
  308. '    Function:    IsFeatureSelected(sFeature)
  309. '
  310. '    Args:        STRING sFeature = `Feature`.`Feature`
  311. '
  312. '    Returns:    True \ False
  313. '
  314. '    Notes:        Determines if a feature is selected for install
  315. '*********************************************************************************************
  316. Function IsFeatureSelected(sFeature)
  317. On Error Resume Next
  318.     Dim nState: nState = getFeatureState(sFeature)
  319.     Dim nAction: nAction = getFeatureAction(sFeature)
  320.  
  321.     If ((nAction > msiInstallStateAbsent) Or ((nState > msiInstallStateAbsent) And (nAction = msiNoAction))) Then
  322.         IsFeatureSelected = True
  323.     Else
  324.         IsFeatureSelected = False
  325.     End If
  326.  
  327. End Function